import {reqTrade,reqUserAddress} from '@/api'
const state={
    orderInfo:{},
    userAddress:[]
};
const actions={
    async getTrade($store){
        let result =await reqTrade();
        console.log(result);
        if(result.data.code==200){
            $store.commit('GETTRADE',result.data.data)
        }
    },
    async getUserAddress($store){
        let result =await reqUserAddress();
        console.log(result);
        if(result.data.code==200){
            $store.commit('GETUSERADDRESS',result.data.data)
        }
    }
};
const mutations={
    GETTRADE(state,data){
        state.orderInfo=data;
    },
    GETUSERADDRESS(state,data){
        state.userAddress=data;
    }
};
const getters={};
export default{
    actions,
    state,
    mutations,
    getters
}